ORC-1384: Fix ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary#1431
Closed
zratkai wants to merge 2 commits into
Closed
ORC-1384: Fix ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary#1431zratkai wants to merge 2 commits into
ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary#1431zratkai wants to merge 2 commits into
Conversation
guiyanakuang
reviewed
Mar 8, 2023
Contributor
|
Thank you for making the PR. |
guiyanakuang
reviewed
Mar 8, 2023
Contributor
|
Actually, the issue blocked the upgrade of ORC in Hive: |
Contributor
Author
|
@deshanxiao thanks for adding this info. Yes, exactly, this was the original issue I started with. To finish it this fix is needed. |
…tream bigger then dictionary ### What changes were proposed in this pull request? Avoid ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary. Check the size of the dictionary and input and read only the min of those. ### Why are the changes needed? In Hive when reading with LLAP data is read in 4kB blocks which leads to ArrayIndexOutOfBoundsException when the dictionary is smaller. ### How was this patch tested? It is tested with HIVE's qtest, since here we do not have the necessary subclasses. This closes apache#1384
dongjoon-hyun
left a comment
Member
There was a problem hiding this comment.
Thank you for making a PR, @zratkai .
- Do you happen to know what caused this regression?
- Do you think you can add a small unit test which you described in the commets?
Member
|
Also cc @williamhyun |
Contributor
Author
|
ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary
dongjoon-hyun
approved these changes
Mar 9, 2023
dongjoon-hyun
left a comment
Member
There was a problem hiding this comment.
+1, LGTM.
Merged to main/1.8 for Apache ORC 1.8.3
dongjoon-hyun
added a commit
that referenced
this pull request
Mar 9, 2023
…y stream bigger then dictionary ### What changes were proposed in this pull request? Avoid ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary. Check the size of the dictionary and input and read only the min of those. ### Why are the changes needed? In Hive when reading with LLAP data is read in 4kB blocks which leads to ArrayIndexOutOfBoundsException when the dictionary is smaller. ### How was this patch tested? It is tested with HIVE's qtest, since here we do not have the necessary subclasses. Closes #1431 from zratkai/ORC-1384. Lead-authored-by: Zoltan Ratkai <zratkai@cloudera.com> Co-authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 8cf9057) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Member
|
Thank you, @zratkai and @guiyanakuang . Also, cc @williamhyun |
Member
cxzl25
pushed a commit
to cxzl25/orc
that referenced
this pull request
Jan 11, 2024
…y stream bigger then dictionary ### What changes were proposed in this pull request? Avoid ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary. Check the size of the dictionary and input and read only the min of those. ### Why are the changes needed? In Hive when reading with LLAP data is read in 4kB blocks which leads to ArrayIndexOutOfBoundsException when the dictionary is smaller. ### How was this patch tested? It is tested with HIVE's qtest, since here we do not have the necessary subclasses. Closes apache#1431 from zratkai/ORC-1384. Lead-authored-by: Zoltan Ratkai <zratkai@cloudera.com> Co-authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Avoid ArrayIndexOutOfBoundsException when reading dictionary stream bigger then dictionary. Check the size of the dictionary and input and read only the min of those.
Why are the changes needed?
In Hive when reading with LLAP data is read in 4kB blocks which leads to ArrayIndexOutOfBoundsException when the dictionary is smaller.
How was this patch tested?
It is tested with HIVE's qtest, since here we do not have the necessary subclasses.